package com.sb.framework.util;

import javax.servlet.http.HttpServletRequest;

public final class PathUtil {
	// 得到Web项目根路径
	public static String getWebPath() {
		return WebUtil.getServletContext().getRealPath( "" );
	}

	// 得到WorkSpace里的工程路径
	public static String getWorkSpaceProjectPath() {
		return System.getProperty( "user.dir" );
	}

	// 得到地址栏请求地址
	public static String getRequestURL(HttpServletRequest request) {
		return request.getRequestURL().toString();
	}

	// 得到classpath 路径
	public static String getClassPathURL() {
		return PathUtil.class.getClassLoader().getResource( "" ).getPath().substring( 1 );
	}

	// 得到catalina.home
	public static String getCatalinaHome() {
		return System.getProperty( "catalina.home" );
	}

	
}
